<template>
  <div class="grandSon">
    我是GrandSon
    <p>----------------</p>
    <span>颜色: {{ color }}</span> ----
    <span>用户信息: {{ userInfo }}</span>
  </div>
</template>

<script>
export default {
  // 2. 通过inject接收provide提供的数据
  inject: ["color", "userInfo"],
};
</script>

<style>
.grandSon {
  border: 3px solid #000;
  border-radius: 6px;
  margin: 10px;
  height: 100px;
}
</style>